<%@page import="com.ksyzt.ksite2.shared.modle.NEWSObj"%>
<%@page import="com.ksyzt.ksite2.server.database.dao.impl.NEWSDAOImpl"%>
<%@page import="com.ksyzt.ksite2.server.database.dao.INEWSDAO"%>
<%@page import="com.ksyzt.ksite2.server.common.PageNaviData"%>
<%@page import="com.ksyzt.ksite2.shared.modle.VW_NEWSObj"%>
<%@page import="com.ksyzt.ksite2.shared.modle.VW_NEWSObjs"%>
<%@page import="com.ksyzt.ksite2.client.column.ColumnType"%>
<%@page import="com.ksyzt.ksite2.shared.modle.COLUMNObjs"%>
<%@page import="com.ksyzt.ksite2.shared.modle.COLUMNObj"%>
<%@page import="com.ksyzt.ksite2.shared.PageData"%>
<%@page import="com.ksyzt.ksite2.server.common.Application"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
	Application app = new Application(request, response);
	PageData pd = app.getApplicationPageData();

	int cid = app.parameterAsInteger("cid", 36);
	int subcid = app.parameterAsInteger("subid", -1);
	int nid = app.parameterAsInteger("nid", 0);

	//根目录
	COLUMNObj column = app.getColumn(cid);
	VW_NEWSObj n = app.getNews(nid);
%>
<!DOCTYPE html>
<html>
<head>
<base href="<%=basePath%>" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><%=pd.getName()%>-<%=column.getNAME()%></title>
<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="0" />
<meta http-equiv="keywords" content="<%=pd.getKeyWords()%>" />
<meta http-equiv="description" content="<%=pd.getSummary()%>" />
<link rel="stylesheet" type="text/css" href="css/comm.css" />
<style type="text/css">
#videocontainer {
	
}

.video-box {
	text-align: center;
	padding: 0px 20px 20px 20px;
}

.video-box .title {
	font-size: 14px;
	font-weight: bold;
	padding: 10px 10px 10px 0px;
	line-height: 26px;
	
}

.video-box .summary {
	font-size: 14px; text-align : left;
	line-height: 26px;
	text-align: left;
	display: none;
}
</style>
<script src="js/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript" src="js/jquery.ksyzt.js"></script>
<script type="text/javascript" src="jwplayer/jwplayer.js"></script>

<script type="text/javascript">
	var link='<%=n.getLINK()%>';
  var base='<%=basePath%>';
  var icon='<%=n.getICON()%>';
  var player=base+'jwplayer/player.swf';
  var video=base+'<%=n.getLINK()%>';
  var preview=base+icon.substring(0,icon.lastIndexOf('.'))+"_s.jpg";
	function load() {

		$(".stylish").makeStylish();
		if(link=='' || link=='null')
			{
			
			}
		else
			{
			thePlayer=jwplayer("videocontainer").setup({
				
				file:video, 
				type:'http',
				primary:'flash',
				image:preview,
			    width:640,
			    height:360
			});
			}
	}
	var thePlayer;

	$(document).ready(load);

	function playerReady(obj) {
		var id = obj['id'];
		var version = obj['version'];
		var client = obj['client'];
		plyr = getPlayer(id);
		plyr.addModelListener("STATE", "stateTracker"); //对状态进行监控
	};
	//状态监控回调函数
	function stateTracker(obj) {
		if (obj["newstate"] == "PAUSED") {
			plyr.sendEvent("PAUSE", true);
		}
		if (obj["newstate"] == "COMPLETED") {
			//do something
		}
		if (obj["newstate"] == "PLAYING") {
			//do something
		}
	}
</script>

</head>

<body>
	<div class="wrap">
		<div class="wrap_center">
			<jsp:include page="../include/top.jsp" />

			<table class="w_970" cellpadding="0" cellspacing="0" >
				<tr>
					<td class='left-back-td' valign="top" >
						<div class="left-back-top">
							<div class="stylish {css:'columnlist'}">
								<%=app.columnlist2html(cid,subcid)%>
							</div>
						</div>
					</td>
					<td valign="top">
					<div class="pagenavi">
						<div class='navibar-left'></div>
						<div class='navibar-middle'>
							<%=app.column2navi(column)%>
							<form style="display: inline;" action="news/search.jsp"
								method="get">
								<table style="float:right;margin-top: 4px;">
									<tr>
										<td><select name="type" class='search_select'>
												<option value="0" selected="selected">内容</option>
												<option value="1">标题</option>
										</select>
										</td>
										<td><input name="w" type="text" value="" />
										</td>
										<td><input type="submit" value="搜索" /></td>
									</tr>
								</table>
							</form>

						</div>
						<div class='navibar-right'></div>
					</div>
					<div class='pagecontent'>
						<div class='video-box'>
							<div style="text-align: center;">
								<div class='title'><%=n.getTITLE()%></div>
								<div class='summary'><%=n.getSUMMARY()%></div>
								<table width="100%">
									<tr>
										<td align="center">
											<div id="videocontainer">
											<%if(n.getLINK()==null || n.getLINK().length()==0){ %>
												<%=n.getCONTENT() %>
											<%} %>
											</div>
										</td>
									</tr>
								</table>

							</div>
						</div>
					</div>
					</td>
				</tr>
			</table>
		</div>
	</div>
	<jsp:include page="../include/bottom.jsp" />
</body>
</html>

